<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>权限管理</title>
</head>
<body class="hold-transition skin-black sidebar-mini">
    <div th:replace="common/fragment :: link"></div>
    <div class="wrapper">
        <div th:replace="common/fragment :: navbar"></div>
        <div th:replace="common/fragment :: menu"></div>
        <div class="content-wrapper">
            <section class="content-header">
                <h1>权限管理</h1>
            </section>
            <section class="content">
                <div class="box" >
                    <!--高级查询--->
                    <form class="form-inline" id="searchForm" action="/permission/list" method="post">
                        <input type="hidden" name="currentPage" id="currentPage" value="1">
                        <a href="javascript:void(0)" class="btn btn-success btn-reload" style="margin: 10px;">
                            <span class="glyphicon glyphicon-repeat"></span>  重新加载
                        </a>
                    </form>
                    <div class="box-body table-responsive ">
                        <table class="table table-hover table-bordered table-striped" >
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>权限名称</th>
                                <th>权限表达式</th>
                            </tr>
                            </thead>
                            <tbody>
                                <tr th:each="permission:${pageInfo.list}">
                                    <td th:text="${permission.id}">1</td>
                                    <td th:text="${permission.name}">部门查询</td>
                                    <td th:text="${permission.expression}">department:list</td>
                                </tr>
                            </tbody>
                        </table>
                        <div th:replace="common/fragment :: page"></div>
                    </div>
                </div>
            </section>
        </div>
        <div th:replace="common/fragment :: footer"></div>
    </div>
</body>
<script>
    $('.btn-reload').click(function () {
        $.post('/permission/load', function (data) {
            if (data.success) {
                location.href = '/permission/list'
            } else {
                alert(data.msg)
            }
        });
    })
</script>
</html>